<?php

namespace App\Api\Logic\Validate;

class UserValidate extends BaseValidate
{
    protected $rule = [
        'nickname'=>'required',
        'account'=>'required|unique:tong_users,account',
        'mobile'=>'required|unique:tong_users,mobile',
        'password'=>'required',
        'share_code'=>'required',
        'check_password'=>'required',
        'type'=>'required',
        'pay_password'=>'required',
        'check_pay_password'=>'required',
        'to_mobile'=>'required',
        'path'=>'required',
        'pageSize'=>'required',
        'page'=>'required',
        'code'=>'required',
        'friend_id'=>'required',
        'phone'=>'required',
        'new_password'=>'required',
        'sms_code'=>'required',
    ];

    protected $message = [
        'nickname.required'=>'请输入昵称',
        'account.required'=>'请输入账号',
        'account.unique'=>'账号已注册',
        'mobile.required'=>'请输入手机号',
        'mobile.unique'=>'手机号已注册',
        'password.required'=>'请输入密码',
        'share_code.required'=>'请输入邀请码',
        'check_password.required'=>'请输入确认密码',
        'type.required'=>'请选择登录的类型',
        'pay_password.required'=>'请输入支付密码',
        'check_pay_password.required'=>'请输入确认支付密码',
        'to_mobile.required'=>'请输入转账人手机号',
        'path.required'=>'请输入小程序的路径',
        'page.required'=>'请输入查看的页数',
        'pageSize.required'=>'请输入每页显示条数',
        'code.required'=>'请输入code',
        'friend_id.required'=>'请输入好友的id',
        'phone.required'=>'请输入手机号',
        'new_password.required'=>'请输入新密码',
        'sms_code.required'=>'请输入验证码'
    ];
    protected $scene = [
        'user_register'=>'nickname,mobile,password,check_password,share_code,sms_code',
        'userLogin'=>'type,code',
        'setPayPassword'=>'pay_password,check_pay_password',
        'getMobileInfo'=>'to_mobile',
        'getUserSharePic'=>'path',
        'getUserFlow'=>'page,pageSize',
        'getFriendUserInfo'=>'friend_id',
        'resetUserPassword'=>'phone,new_password,sms_code',
        'getChildUser'=>'page,pageSize',
        'getAllChildUser'=>'page,pageSize',
        'getChildUserTwo'=>'friend_id,page,pageSize',
    ];
}
